<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<body>
<div id="app">
    <input type="button" value="切换显示状态" @click="changeIsShow">
    <input type="button" value="年岁增长" @click="addAge">
    <p>我今年{{age}}岁了</p>
    <img v-show="isShow" src="../img/zyeb.jpg">
    <img v-show="age>=18" src="../img/zyeb.jpg">
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            isShow:false,
            age:17
        },
        methods:{
            changeIsShow:function () {
                this.isShow = !this.isShow;
            },
            addAge:function () {
                this.age++;
            }
        }
    })

</script>
</body>
</body>
</html>